{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2d71a267",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Folder 0 - suma bajtów: 842283\n",
      "Folder 1 - suma bajtów: 843428\n",
      "Folder 2 - suma bajtów: 859393\n",
      "Folder 3 - suma bajtów: 844942\n",
      "Folder 4 - suma bajtów: 858788\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "import shutil\n",
    "\n",
    "folder_x = 'foldy/fold_0/test/nonaf'  # skąd bierzemy listę nazw\n",
    "folder_y = 'output_af/b'  # skąd kopiujemy pliki\n",
    "folder_z = '/foldy/fold_0/test/af'  # dokąd kopiujemy pliki\n",
    "\n",
    "# Upewnij się, że folder Z istnieje\n",
    "os.makedirs(folder_z, exist_ok=True)\n",
    "\n",
    "# Pobierz nazwy plików z folderu X\n",
    "file_names = os.listdir(folder_x)\n",
    "\n",
    "# Dla każdej nazwy, kopiuj plik z Y do Z (jeśli istnieje)\n",
    "for file_name in file_names:\n",
    "    src = os.path.join(folder_y, file_name)\n",
    "    dst = os.path.join(folder_z, file_name)\n",
    "    if os.path.isfile(src):\n",
    "        shutil.copy2(src, dst)\n",
    "        print(f\"Skopiowano: {file_name}\")\n",
    "    else:\n",
    "        print(f\"Nie znaleziono w folderze Y: {file_name}\")\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
